<?php
/**
 * 网页元素
 *
 * @version        $Id: ad_main.php 1 8:26 2010年7月12日Z tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */

require_once(dirname(__FILE__).'/config.php');
require_once(DEDEINC.'/datalistcp.class.php');
require_once(DEDEINC.'/common.func.php');
require_once(DEDEADMIN.'/inc/inc_web.class.php');
require_once(DEDEADMIN.'/inc/inc_catalog_options.php');
setcookie('ENV_GOBACK_URL',$dedeNowurl,time()+3600,'/');
$arctype_id = isset($arctype_id)? intval($arctype_id) : 0;
$title = isset($title)? addslashes($title) : '';
$channelid = empty($channelid) ? 0 : intval($channelid);
$cid = empty($cid) ? 0 : intval($cid);
$where_sql = ' 1 ';
if ($arctype_id){
	$where_sql .=" and arctype_id=".$arctype_id;
}
if ($title){
	$where_sql .= " and title like '%".$title."%'";
}
if ($position){
	$where_sql .= " and position = '".$position."'";
}
$sql = "SELECT * FROM `#@__web` WHERE $where_sql ORDER BY web_id desc";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN."/templets/web_main.htm");
$dlist->SetSource($sql);
$dlist->display();
//inc_web::select_position_option($postion)
function geTarctypeName($id){
	global $dsql;
	$row = $dsql->GetOne("SELECT typename FROM `#@__arctype` WHERE id='$id'");
	return $row['typename'];
}
